/**
 * @mbggenerated
 * @author wujian
 */
package bearworker.zxl.dao.mapper;

import bearworker.zxl.entity.ManagerMenu;
import org.apache.ibatis.jdbc.SQL;

public class ManagerMenuSqlProvider {

    /* @mbggenerated */
    public String insertSelective(ManagerMenu record) {
        return new SQL() {
            {
                INSERT_INTO("manager_menu");

                if (record.getId() != null) {
                    VALUES("id", "#{id,jdbcType=INTEGER}");
                }

                if (record.getMenuName() != null) {
                    VALUES("menu_name", "#{menuName,jdbcType=VARCHAR}");
                }

                if (record.getUrl() != null) {
                    VALUES("url", "#{url,jdbcType=VARCHAR}");
                }

                if (record.getMethod() != null) {
                    VALUES("method", "#{method,jdbcType=VARCHAR}");
                }

                if (record.getParentId() != null) {
                    VALUES("parent_id", "#{parentId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    VALUES("state", "#{state,jdbcType=TINYINT}");
                }

                if (record.getCreateUser() != null) {
                    VALUES("create_user", "#{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    VALUES("create_time", "#{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    VALUES("upd_user", "#{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdateTime() != null) {
                    VALUES("update_time", "#{updateTime,jdbcType=TIMESTAMP}");
                }

                if (record.getMenuKey() != null) {
                    VALUES("menu_key", "#{menuKey,jdbcType=VARCHAR}");
                }

                if (record.getSort() != null) {
                    VALUES("sort", "#{sort,jdbcType=INTEGER}");
                }

                if (record.getIsDisplay() != null) {
                    VALUES("is_display", "#{isDisplay,jdbcType=TINYINT}");
                }

                if (record.getIsLogin() != null) {
                    VALUES("is_login", "#{isLogin,jdbcType=TINYINT}");
                }

            }
        }.toString();
    }

    /* @mbggenerated */
    public String updateByPrimaryKeySelective(ManagerMenu record) {
        return new SQL() {
            {
                UPDATE("manager_menu");

                if (record.getMenuName() != null) {
                    SET("menu_name = #{menuName,jdbcType=VARCHAR}");
                }

                if (record.getUrl() != null) {
                    SET("url = #{url,jdbcType=VARCHAR}");
                }

                if (record.getMethod() != null) {
                    SET("method = #{method,jdbcType=VARCHAR}");
                }

                if (record.getParentId() != null) {
                    SET("parent_id = #{parentId,jdbcType=INTEGER}");
                }

                if (record.getState() != null) {
                    SET("state = #{state,jdbcType=TINYINT}");
                }

                if (record.getCreateUser() != null) {
                    SET("create_user = #{createUser,jdbcType=INTEGER}");
                }

                if (record.getCreateTime() != null) {
                    SET("create_time = #{createTime,jdbcType=TIMESTAMP}");
                }

                if (record.getUpdUser() != null) {
                    SET("upd_user = #{updUser,jdbcType=INTEGER}");
                }

                if (record.getUpdateTime() != null) {
                    SET("update_time = #{updateTime,jdbcType=TIMESTAMP}");
                }

                if (record.getMenuKey() != null) {
                    SET("menu_key = #{menuKey,jdbcType=VARCHAR}");
                }

                if (record.getSort() != null) {
                    SET("sort = #{sort,jdbcType=INTEGER}");
                }

                if (record.getIsDisplay() != null) {
                    SET("is_display = #{isDisplay,jdbcType=TINYINT}");
                }

                if (record.getIsLogin() != null) {
                    SET("is_login = #{isLogin,jdbcType=TINYINT}");
                }

                WHERE("id = #{id,jdbcType=INTEGER}");

            }
        }.toString();
    }
}